<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
    <style>
        .container {
            width: 400px;
            margin: 0 auto;
        }
        p{
            text-align: center;
        }
    </style>
</head>

<body>
    <div class="container">
        <p>不能添加空的文本</p>
        <div class="input">
            <input type="text">
            <button>添加</button>
        </div>
        <ul class="list">
            <li>项目1</li>
            <li>项目2</li>
        </ul>
    </div>

</body>

</html>